package com.tianyu.service.mqtt.handler.outbound;

import com.tianyu.service.mqtt.common.MqttMessageChannel;
import org.springframework.integration.annotation.Gateway;
import org.springframework.integration.annotation.MessagingGateway;
import org.springframework.integration.mqtt.support.MqttHeaders;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.stereotype.Service;

@Service
@MessagingGateway
public interface IMqttOutboundMessageGateway {

    @Gateway(requestChannel = MqttMessageChannel.ChannelName.OUTBOUND)
    void publish(@Header(MqttHeaders.TOPIC) String topic, byte[] payload);

    @Gateway(requestChannel = MqttMessageChannel.ChannelName.OUTBOUND)
    void publish(@Header(MqttHeaders.TOPIC) String topic, @Header(MqttHeaders.QOS) int qos, byte[] payload);

}